<?
	// Drop down for choosing a restaurant and a week.
	function drawRestAndWeekChoiceForm($action = "infoadmin.php", $nextact="toUploadFile")
	{
?>
		<form method = "post" action = "<?= $action; ?>">
			<label>Woche:</label>
			<? drawCurrentAndNextWeekDropDown(); ?><div class="clear"></div>

			<label>Restaurant:</label>
			<?	printRestaurantsDropDown(); ?><div class="clear"></div>

			<input type = "hidden" name = "action" value = "<?=$nextact; ?>"><br /><br />
			<input type = "submit" value = "weiter...">
		</form>
<?
	}

	// Drop down for the current and next week
	function drawCurrentAndNextWeekDropDown()
	{
		$week = date("W");
?>
		<select name = "week">
			<option value = "<?= $week; ?>">KW <?= $week; ?> / <?= getFirstAndLastDayOfWeek($week); ?></option>
			<option value = "<?= $week + 1; ?>">KW <?= $week+1; ?> / <?= getFirstAndLastDayOfWeek($week+1); ?></option>
		</select>
<?
	}

	// Drop down for all restaurants
	function printRestaurantsDropDown()
	{
		$link = getDbLink();
		$query = sprintf("select id, name from restaurants");
		$result = mysql_query($query, $link);

		?> <select name = "rest_id"> <?
		while($rv=mysql_fetch_array($result))
		{
			?> <option value = "<?= $rv["id"]; ?>"><?= $rv["name"]; ?></option> <?
		}
		?> </select> <?
	}

	// Prints a textare with the given name and content.
	function drawTextArea($name, $content)
	{
		?> <textarea name = "<?= $name; ?>" cols="65" rows="6"><?= $content; ?></textarea> <?
	}
?>